package com.gxa.uhome.pojo;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.gxa.uhome.group.Login;
import com.gxa.uhome.group.Reg;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import java.util.List;

@ApiModel(value = "管理员实体类")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class TbAdmin {
    /**
     * 管理员id
     */
    @ApiModelProperty(value = "管理员id")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Integer adminId;

    /**
     * 管理员用户名
     */
    @ApiModelProperty(value = "管理员用户名")
    @NotNull(message = "用户名不能为空！", groups = {Login.class, Reg.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String adminNickname;

    /**
     * 管理员密码
     */
    @ApiModelProperty(value = "管理员密码")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String adminPwd;

    /**
     * 管理员真实姓名
     */
    @ApiModelProperty(value = "管理员真实姓名")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String adminRealname;
    /**
     * 管理员拥有的角色
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private List<TbRole> roles;
}